// ActionScript file
import com.adobe.cairngorm.control.CairngormEventDispatcher;

import formats.MoneyFormat;

import net.optix.ip.events.AssignToFirmEvent;
import net.optix.ip.events.GetBudgetsEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.AssignVO;

private var moneyFormat:MoneyFormat	=	new MoneyFormat();

[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

[Bindable]
private var imageOK:String	=	"status-ok.png";

private function initApp():void
{
	model.bSubmit	=	true;
	var getBudgets:GetBudgetsEvent	=	new GetBudgetsEvent(model.currentTradeMark.tradeMarkID,1);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(getBudgets);
}

private function assignToFirm():void
{
	model.bSubmit	=	false;
	
	var firmID:int	=	budgets.selectedItem.firmID;
	
	var vo:AssignVO	=	new AssignVO();
	vo.type			=	1;
	vo.id			=	model.currentTradeMark.tradeMarkID;
	vo.firmID		=	firmID;
	
	var event:AssignToFirmEvent	=	new AssignToFirmEvent(vo);
	CairngormEventDispatcher.getInstance().dispatchEvent(event);
}

public function addFirm():void
{
	
}